package com.zhehekeji.opsys.api.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

// Generated 2015-8-6 15:03:31 by Hibernate Tools 3.4.0.CR1

import lombok.Data;

/**
 * TCmsSeries generated by hbm2java
 */
@Data
@Entity
@Table(name = "t_cms_series")
public class TCmsSeries implements java.io.Serializable {

    /**
     * @Fields serialVersionUID : TODO
     */
    private static final long serialVersionUID = -8399585391670245586L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID", length = 20, nullable = false, unique = true)
    private Long id;

    @Column(name = "ORIGINAL_CODE", length = 64, nullable = true)
    private String originalCode;

    @Column(name = "CODE", length = 64, nullable = true)
    private String code;

    @Column(name = "NAME", length = 128, nullable = true)
    private String name;

    @Column(name = "ORIGINAL_NAME", length = 128, nullable = true)
    private String originalName;

    @Column(name = "ORDER_NUMBER", length = 10, nullable = true)
    private String orderNumber;

    @Column(name = "SORT_NAME", length = 128, nullable = true)
    private String sortName;

    @Column(name = "SEARCH_NAME", length = 128, nullable = true)
    private String searchName;

    @Column(name = "GENRE", length = 128, nullable = true)
    private String genre;

    @Column(name = "DIRECTOR_DISPLAY", length = 256, nullable = true)
    private String directorDisplay;

    @Column(name = "ACTOR_DISPLAY", length = 256, nullable = true)
    private String actorDisplay;

    @Column(name = "WRITER_DISPLAY", length = 256, nullable = true)
    private String writerDisplay;

    @Column(name = "ORIGINAL_COUNTRY", length = 64, nullable = true)
    private String originalCountry;

    @Column(name = "LANGUAGE", length = 64, nullable = true)
    private String language;

    @Column(name = "RELEASE_YEAR", length = 12, nullable = true)
    private String releaseYear;

    @Column(name = "ORG_AIR_DATE", length = 8, nullable = true)
    private String orgAirDate;

    @Column(name = "LICENSING_WINDOW_START", length = 14, nullable = true)
    private String licensingWindowStart;

    @Column(name = "LICENSING_WINDOW_END", length = 14, nullable = true)
    private String licensingWindowEnd;

    @Column(name = "DISPLAY_AS_NEW", length = 3, nullable = true)
    private String displayAsNew;

    @Column(name = "DISPLAY_AS_LAST_CHANCE", length = 3, nullable = true)
    private String displayAsLastChance;

    @Column(name = "MACROVISION", length = 1, nullable = true)
    private Integer macrovision;

    @Column(name = "DESCRIPTION", length = 4000, nullable = true)
    private String description;

    @Column(name = "PRICE_TAX_IN", nullable = true)
    private Double priceTaxIn;

    @Column(name = "SOURCE_TYPE", length = 1, nullable = true)
    private Integer sourceType;

    @Column(name = "SERIES_FLAG", length = 1, nullable = true)
    private Integer seriesFlag;

    @Column(name = "TYPE", length = 128, nullable = true)
    private String type;

    @Column(name = "CONTENT_TYPE", length = 11, nullable = true)
    private Integer contentType;

    @Column(name = "KEYWORDS", length = 256, nullable = true)
    private String keywords;

    @Column(name = "RESERVE1", length = 1024, nullable = true)
    private String reserve1;

    @Column(name = "RESERVE2", length = 1024, nullable = true)
    private String reserve2;

    @Column(name = "RESERVE3", length = 1024, nullable = true)
    private String reserve3;

    @Column(name = "RESERVE4", length = 1024, nullable = true)
    private String reserve4;

    @Column(name = "RESERVE5", length = 1024, nullable = true)
    private String reserve5;

    @Column(name = "STORAGE_TYPE", length = 2, nullable = true)
    private String storageType;

    @Column(name = "RMEDIA_CODE", length = 128, nullable = true)
    private String rmediaCode;

    @Column(name = "DEFINITION_FLAG", length = 1, nullable = true)
    private Integer definitionFlag;

    @Column(name = "TAGS", length = 256, nullable = true)
    private String tags;

    @Column(name = "POSTER_URL", length = 1024, nullable = true)
    private String posterUrl;

    @Column(name = "THUMBNAIL_URL", length = 1024, nullable = true)
    private String thumbnailUrl;

    @Column(name = "RECOMMEND_URL", length = 1024, nullable = true)
    private String recommendUrl;

    @Column(name = "STILL_URL", length = 1024, nullable = true)
    private String stillUrl;

    @Column(name = "VOLUMN_COUNT", length = 11, nullable = true)
    private Integer volumnCount;

    @Column(name = "STATUS", length = 2, nullable = true)
    private Integer status;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "ONLINE_TIME", nullable = true)
    private Date onlineTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "OFFLINE_TIME", nullable = true)
    private Date offlineTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_TIME", nullable = true)
    private Date updateTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_TIME", nullable = true)
    private Date createTime;

    @Column(name = "CP_CODE", length = 20, nullable = true)
    private Long cpCode;
    
    @Column(name = "CHANNEL_URL", length = 256, nullable = true)
    private String channelUrl;
    /**
     * 20160624添加已更新集数
     */
    @Column(name = "UPDATE_COUNT", length = 11, nullable = true)
    private Integer updateCount;
    
    @Column(name = "ISP", length = 1024, nullable = true)
    private String isp;
    
    /**
                * 一级分类
     */
    @Column(name = "PROGRAM_TYPE", length = 64, nullable = true)
	private String programType;
	
    /**
     * 2级分类
     */
	@Column(name = "PROGRAM_TYPE2", length = 64, nullable = true)
	private String programType2;
	
	@Column(name = "CMD_ID", length = 20, nullable = true)
    private Long cmdId;
	
    /**
     * 生成大洋XML时会使用
     */
    @Transient
    private List<TCmsProgram> tcmsPrograms;

    @Transient
    private List<TCmsCategory> tcmsCategorys;

    @Transient
    private String nanChuanPublishStatus;

    @Transient
    private String cisPublishStatus;

    public TCmsSeries() {
    }

    public TCmsSeries(String originalCode, String code, String name,
                      String originalName, String orderNumber, String sortName,
                      String searchName, String genre, String directorDisplay,
                      String actorDisplay, String writerDisplay, String originalCountry,
                      String language, String releaseYear, String orgAirDate,
                      String licensingWindowStart, String licensingWindowEnd,
                      String displayAsNew, String displayAsLastChance,
                      Integer macrovision, String description, Double priceTaxIn,
                      Integer sourceType, Integer seriesFlag, String type, Integer contentType,
                      String keywords, String reserve1, String reserve2, String reserve3,
                      String reserve4, String reserve5, String storageType,
                      String rmediaCode, Integer definitionFlag, String tags,
                      String posterUrl, String thumbnailUrl, String recommendUrl,
                      String stillUrl, Integer volumnCount, Integer status,
                      Date updateTime, Date createTime, Long cpCode) {
        this.originalCode = originalCode;
        this.code = code;
        this.name = name;
        this.originalName = originalName;
        this.orderNumber = orderNumber;
        this.sortName = sortName;
        this.searchName = searchName;
        this.genre = genre;
        this.directorDisplay = directorDisplay;
        this.actorDisplay = actorDisplay;
        this.writerDisplay = writerDisplay;
        this.originalCountry = originalCountry;
        this.language = language;
        this.releaseYear = releaseYear;
        this.orgAirDate = orgAirDate;
        this.licensingWindowStart = licensingWindowStart;
        this.licensingWindowEnd = licensingWindowEnd;
        this.displayAsNew = displayAsNew;
        this.displayAsLastChance = displayAsLastChance;
        this.macrovision = macrovision;
        this.description = description;
        this.priceTaxIn = priceTaxIn;
        this.sourceType = sourceType;
        this.seriesFlag = seriesFlag;
        this.type = type;
        this.contentType = contentType;
        this.keywords = keywords;
        this.reserve1 = reserve1;
        this.reserve2 = reserve2;
        this.reserve3 = reserve3;
        this.reserve4 = reserve4;
        this.reserve5 = reserve5;
        this.storageType = storageType;
        this.rmediaCode = rmediaCode;
        this.definitionFlag = definitionFlag;
        this.tags = tags;
        this.posterUrl = posterUrl;
        this.thumbnailUrl = thumbnailUrl;
        this.recommendUrl = recommendUrl;
        this.stillUrl = stillUrl;
        this.volumnCount = volumnCount;
        this.status = status;
        this.updateTime = updateTime;
        this.createTime = createTime;
        this.cpCode = cpCode;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((code == null) ? 0 : code.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        TCmsSeries other = (TCmsSeries) obj;
        if (code == null) {
            if (other.code != null) {
                return false;
            }
        } else if (!code.equals(other.code)) {
            return false;
        }
        return true;
    }
}
